package com.wuhan.template.module.find;


import android.content.Intent;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.RadioButton;

import com.wuhan.template.R;
import com.wuhan.template.base.BaseFragment;
import com.wuhan.template.module.find.activity.ChengquActivity;
import com.wuhan.template.module.find.activity.LoginActivity;
import com.wuhan.template.module.find.activity.LukuangActivity;
import com.wuhan.template.module.find.activity.MeishiActivity;
import com.wuhan.template.module.find.activity.WeatherActivity;
import com.wuhan.template.module.find.activity.WenzhengActivity;
import com.wuhan.template.module.find.activity.ZhengwuActivity;
import com.wuhan.template.module.find.activity.ZhuantiActivity;
import com.wuhan.template.module.find.webview.WebViewActivity;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * A simple {@link Fragment} subclass.
 */
public class FindFragment extends BaseFragment {

    @BindView(R.id.btn_news)
    RadioButton mRbXinwen;
    @BindView(R.id.btn_live)
    RadioButton mRbZhibo;
    @BindView(R.id.btn_demand)
    RadioButton mRbDianbo;
    @BindView(R.id.btn_focus)
    RadioButton mRbZhuanti;
    @BindView(R.id.btn_wenzheng)
    RadioButton mRbWenzheng;
    @BindView(R.id.btn_gongjiao)
    RadioButton mRbGongjiao;
    @BindView(R.id.btn_huoche)
    RadioButton mRbHuoche;
    @BindView(R.id.btn_feiji)
    RadioButton mRbFeiji;
    @BindView(R.id.btn_keyun)
    RadioButton mRbKeyun;
    @BindView(R.id.btn_shimin)
    RadioButton mRbshimin;
    @BindView(R.id.btn_lukuang)
    RadioButton mRblukuang;
    @BindView(R.id.btn_chengqu)
    RadioButton mRbChengqu;
    @BindView(R.id.btn_meishi)
    RadioButton mRbMeihsi;
    @BindView(R.id.btn_qinzi)
    RadioButton mRbQinzi;
    @BindView(R.id.btn_zhengwu)
    RadioButton mRbZhengwu;
    @BindView(R.id.btn_tianqi)
    RadioButton mRbTianqi;




    @OnClick({R.id.btn_focus, R.id.btn_demand, R.id.btn_live,
            R.id.btn_gongjiao, R.id.btn_wenzheng, R.id.btn_huoche,
            R.id.btn_keyun, R.id.btn_feiji, R.id.btn_shimin, R.id.btn_lukuang,
            R.id.btn_chengqu,R.id.btn_meishi,R.id.btn_qinzi
            ,R.id.btn_zhengwu,R.id.btn_tianqi,R.id.btn_yaoyiyao

    })
    void onclick(View view) {
        Intent intent;
        switch (view.getId()) {
            case R.id.btn_gongjiao:
                intent = new Intent(getContext(), WebViewActivity.class);
                intent.putExtra("url", "http://www.wbus.cn/q2.jsp");
                intent.putExtra("title", "公交");
                startActivity(intent);
                break;
            case R.id.btn_focus:
                intent = new Intent(getContext(), ZhuantiActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_wenzheng:
                intent = new Intent(getContext(), WenzhengActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_huoche:
                intent = new Intent(getContext(), WebViewActivity.class);
                intent.putExtra("url", "http://m.ctrip.com/webapp/train/?allianceid=292191&sid=748262&ouid=000401app-&utm_medium=&utm_campaign=&utm_source=&isctrip=");
                intent.putExtra("title", "火车");
                startActivity(intent);
                break;
            case R.id.btn_feiji:
                intent = new Intent(getContext(), WebViewActivity.class);
                intent.putExtra("url", "http://m.ctrip.com/html5/flight/matrix.html?allianceid=292191&sid=748262&ouid=000401app-&utm_medium=&utm_campaign=&utm_source=&isctrip=");
                intent.putExtra("title", "飞机");
                startActivity(intent);
                break;
            case R.id.btn_keyun:
                intent = new Intent(getContext(), WebViewActivity.class);
                intent.putExtra("url", "http://m.ctrip.com/html5/flight/matrix.html?allianceid=292191&sid=748262&ouid=000401app-&utm_medium=&utm_campaign=&utm_source=&isctrip=");
                intent.putExtra("title", "客运");
                startActivity(intent);
                break;
            case R.id.btn_shimin:
                intent = new Intent(getContext(), WebViewActivity.class);
                intent.putExtra("url", "http://59.175.192.205:8080/weixin/bscx/index.jhtml");
                intent.putExtra("title", "市民之家");
                startActivity(intent);
                break;
            case R.id.btn_lukuang:
                intent = new Intent(getContext(), LukuangActivity.class);
                intent.putExtra("title", "路况");
                startActivity(intent);
                break;
            case R.id.btn_chengqu:
                intent = new Intent(getContext(), ChengquActivity.class);
                intent.putExtra("title", "城区");
                startActivity(intent);
                break;
            case R.id.btn_meishi:
                intent = new Intent(getContext(), MeishiActivity.class);
                intent.putExtra("title", "美食");
                startActivity(intent);
                break;
            case R.id.btn_qinzi:
                intent = new Intent(getContext(), MeishiActivity.class);
                intent.putExtra("title", "亲子");
                startActivity(intent);
                break;
            case R.id.btn_zhengwu:
                intent = new Intent(getContext(), ZhengwuActivity.class);
                intent.putExtra("title", "政务");
                startActivity(intent);
                break;
            case R.id.btn_tianqi:
                intent = new Intent(getContext(), WeatherActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_yaoyiyao:
                intent = new Intent(getContext(), LoginActivity.class);
                startActivity(intent);
                break;

        }
    }


    public FindFragment() {}

    @Override
    protected void initViews() {}

    @Override
    protected int getLayoutId() {
        return R.layout.frag_find_layout;
    }
}
